<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/inc::header"/>
<body>
<form class="layui-form" style="margin-top: 15px">
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 100px">选择考场:</label>
        <div class="layui-input-inline">
            <select name="examineeHallId" id="examineeHallId" lay-filter="examineeHallId">
                <option value="">全部</option>
            </select>
        </div>
        <label class="layui-form-label" style="width: 60px">时间:</label>
        <div class="layui-input-inline">
            <input type="text" name="startTime" id="startTime"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="text" name="endTime" id="endTime"
                   class="layui-input">
        </div>
        <button class="layui-btn" id="searchBtn" lay-submit lay-filter="searchBtn">查询</button>
    </div>
</form>
<table class="layui-table" id="grid" lay-filter="grid">
</table>
<script th:replace="/common/inc::incJs"></script>
<script>
    var allStr;

    $(function () {
        $.post('/backend/security/examineeHall/getAllHall', function (res) {
            if (res.code < 0) {
                layer.msg(res.message);
            } else {
                $.each(res.body, function (i, item) {
                    $("#examineeHallId").append("<option value='" + item.id + "'>" + item.examineeHallName + "</option>");
                });
                form.render('select');
            }
        });

        var tableIns = createTable({
            url: 'list',
            cols: [[{field: 'id', title: '系统编号', width: 150},
                {field: 'examineeName', title: '考生名称', width: 200}, {
                    field: 'examineeHallName',
                    title: '所在考场',
                    width: 160
                }, {
                    field: 'createTime',
                    title: '识别时间',
                    width: 180
                }, {field: 'discriminateResult', title: '识别结果', width: 200}
            ]]
        });

        layui.form.on('submit(searchBtn)', function (data) {
            tableIns.reload({
                where: data.field
            });
            return false;
        });
    })
</script>
</body>
</html>
